﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OAuth;
using YammerTestApp.Properties;

namespace YammerTestApp
{
    class TokenSettingsStorage : IAccessTokenStorage
    {
        public string TokenValue
        {
            get
            {
                return Settings.Default.Token;
            } 
            set
            {
                Settings.Default.Token = value;
                if (!(string.IsNullOrEmpty(value) ^ string.IsNullOrEmpty(TokenSecret)))
                    Settings.Default.Save();
            }
        }

        public string TokenSecret
        {
            get
            {
                return Settings.Default.Secret;
            } 
            set
            {
                Settings.Default.Secret = value;
                if (!(string.IsNullOrEmpty(value) ^ string.IsNullOrEmpty(TokenValue)))
                    Settings.Default.Save();
            }
        }
    }
}
